/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * RetirarEstudiante.java
 *
 * Created on 17/02/2011, 12:27:00 PM
 */

package Pantallas;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 *
 * @author Reinaldo Carvallo
 */
public class RetirarEstudiante extends javax.swing.JFrame {

    /** Creates new form RetirarEstudiante */
    public RetirarEstudiante() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        txtCedula = new javax.swing.JTextField();
        btnAceptar = new javax.swing.JButton();
        btnSalir = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(null);

        jLabel1.setText("RetirarEstudiante");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(210, 30, 130, 14);

        jLabel2.setText("Cedula");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(93, 120, 80, 14);

        txtCedula.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtCedulaActionPerformed(evt);
            }
        });
        getContentPane().add(txtCedula);
        txtCedula.setBounds(200, 120, 190, 19);

        btnAceptar.setText("Aceptar");
        btnAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarActionPerformed(evt);
            }
        });
        getContentPane().add(btnAceptar);
        btnAceptar.setBounds(110, 240, 110, 23);

        btnSalir.setText("Salir");
        btnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalirActionPerformed(evt);
            }
        });
        getContentPane().add(btnSalir);
        btnSalir.setBounds(240, 240, 120, 23);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-500)/2, (screenSize.height-360)/2, 500, 360);
    }// </editor-fold>//GEN-END:initComponents

    private void btnAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarActionPerformed
        // TODO add your handling code here:
        if(txtCedula.getText().equals(""))
        {
            JOptionPane.showMessageDialog(new JFrame(),"Introduzca la Cedula","Aviso",JOptionPane.CANCEL_OPTION);
        }
        else{
            MenuPrincipal.s1.eliminar(MenuPrincipal.e1,txtCedula.getText());
            txtCedula.setText("");
           // JOptionPane.showMessageDialog(new JFrame(),"Estudiante Retirado de la seccion Exitosamente","Aviso",JOptionPane.CANCEL_OPTION);
        }
        

    }//GEN-LAST:event_btnAceptarActionPerformed

    private void txtCedulaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCedulaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtCedulaActionPerformed

    private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
        // TODO add your handling code here:
        dispose();
    }//GEN-LAST:event_btnSalirActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new RetirarEstudiante().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAceptar;
    private javax.swing.JButton btnSalir;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JTextField txtCedula;
    // End of variables declaration//GEN-END:variables

}
